package com.checkoutcheckins.server.database;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.checkoutcheckins.client.data.foursquare.FoursquareUser;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class CheckoutCheckinsUser implements Serializable {

	private static final long serialVersionUID = 584082150046443083L;

	@PrimaryKey
	@Persistent
	private String foursquareid;

	@Persistent
	private String oauthtoken;

	@Persistent
	private String oauthsecret;

	@Persistent
	private String lastcheckinid;

	@Persistent
	private Date created;

	@Persistent
	private Date lastLoggedIn;

	public CheckoutCheckinsUser(FoursquareUser fsUser, String foursquareToken,
			String foursquareSecret) {
		foursquareid = fsUser.getId();
		oauthtoken = foursquareToken;
		oauthsecret = foursquareSecret;
		lastcheckinid = "0";
		created = new Date();
		lastLoggedIn = new Date();
	}

	public String getFoursquareid() {
		return foursquareid;
	}

	public void setFoursquareid(String foursquareid) {
		this.foursquareid = foursquareid;
	}

	public String getOauthtoken() {
		return oauthtoken;
	}

	public void setOauthtoken(String oauthtoken) {
		this.oauthtoken = oauthtoken;
	}

	public String getOauthsecret() {
		return oauthsecret;
	}

	public void setOauthsecret(String oauthsecret) {
		this.oauthsecret = oauthsecret;
	}

	public String getLastcheckinid() {
		return lastcheckinid;
	}

	public void setLastcheckinid(String lastcheckinid) {
		this.lastcheckinid = lastcheckinid;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getLastLoggedIn() {
		return lastLoggedIn;
	}

	public void setLastLoggedIn(Date lastLoggedIn) {
		this.lastLoggedIn = lastLoggedIn;
	}

}
